import request from '@/utils/request';

export type ArticlePageParamsType = {
  q: string;
  page?: number;
  per_page?: number;
};

/** 根据关键字搜索文章Api */
export function GetArticleByKeyWordApi(params: ArticlePageParamsType) {
  return request({
    url: '/v1_0/search',
    params: { ...JSON.parse(JSON.stringify(params)) },
  });
}

/** 根据关键字联想补全 Api */
export function GetKeywordBysuggestApi(keyword: string) {
  return request({
    url: '/v1_0/suggestion',
    params: { q: keyword },
  });
}
